FIX: Eliminate distortions in phasediff images caused by unmasked fieldmap estimates #3094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
To recap how fieldmaps are handled in fMRIPrep, we have multiple ways of computing a fieldmap:
The voxel shift map is a brittle representation, and the direct field estimate potentially contains high frequency spatial noise. We therefore have shifted to the following method:
The problems we're seeing in #3013, #3093, etc, occur in the application stage for case 2. Here, the field is extremely noisy outside the skull, and so we can only get a good fit of the field in-brain by fitting the splines to the masked image. Because there are peaks going to the edge of the mask, the splines actually fit peaks outside the brain, and reconstructing the field without applying the mask to the result produces nonsense that pulls EPI signal outside the brain.
The good news is that the values inside the brain are basically fine, and the main problem is that it is difficult to assess the quality with such large distortions. However, if these distortions affect the coregistration, that could also produce problems.
In any event, this PR starts to fix it. I need to test to make sure that this is not introducing regressions for pepolar or SyN-SDC.
Fixes #3013.
Documentation that should be reviewed